home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / unixcpio.gz / unixnet.cpio / pktdrvr.h < prev    next >
C/C++ Source or Header  |  1994-07-11  |  2KB  |  73 lines

  1. /* Packet driver interface classes */
  2. #define    ETHERNET    1
  3. #define    PRONET-10    2
  4. #define    IEEE8025    3
  5. #define    OMNINET        4
  6. #define    APPLETALK    5
  7. #define    SERIAL_LINE    6
  8. #define    STARLAN        7
  9. #define    ARCNET        8
  10.  
  11. /* Packet driver interface types (not a complete list) */
  12. #define    TC500        1
  13. #define    PC2000        10
  14. #define    WD8003        14
  15. #define    ANYTYPE        0xffff
  16.  
  17. /* Packet driver function call numbers. From Appendix B. */
  18. #define    DRIVER_INFO        1
  19. #define    ACCESS_TYPE        2
  20. #define    RELEASE_TYPE        3
  21. #define    SEND_PKT        4
  22. #define    TERMINATE        5
  23. #define    GET_ADDRESS        6
  24. #define    RESET_INTERFACE        7
  25. #define    SET_RCV_MODE        20
  26. #define    GET_RCV_MODE        21
  27. #define    SET_MULTICAST_LIST    22
  28. #define    GET_MULTICAST_LIST    23
  29. #define    GET_STATISTICS        24
  30.  
  31. /* Packet driver error return codes. From Appendix C. */
  32.  
  33. #define    NO_ERROR    0
  34. #define    BAD_HANDLE    1    /* invalid handle number */
  35. #define    NO_CLASS    2    /* no interfaces of specified class found */
  36. #define    NO_TYPE        3    /* no interfaces of specified type found */
  37. #define    NO_NUMBER    4    /* no interfaces of specified number found */
  38. #define    BAD_TYPE    5    /* bad packet type specified */
  39. #define    NO_MULTICAST    6    /* this interface does not support multicast */
  40. #define    CANT_TERMINATE    7    /* this packet driver cannot terminate */
  41. #define    BAD_MODE    8    /* an invalid receiver mode was specified */
  42. #define    NO_SPACE    9    /* operation failed because of insufficient space */
  43. #define    TYPE_INUSE    10    /* the type had previously been accessed, and not released */
  44. #define    BAD_COMMAND    11    /* the command was out of range, or not    implemented */
  45. #define    CANT_SEND    12    /* the packet couldn't be sent (usually    hardware error) */
  46.  
  47. typedef union {
  48.     struct {
  49.         unsigned char lo;
  50.         unsigned char hi;
  51.     } byte;
  52.     unsigned short word;
  53. } ureg;
  54.  
  55. #define    CARRY_FLAG    0x1
  56.  
  57. struct pktdrvr {
  58.     int class;    /* Interface class (ether/slip/etc) */
  59.     int intno;    /* Interrupt vector */
  60.     short handle1;    /* Driver handle(s) */
  61.     short handle2;
  62.     struct mbuf *buffer;    /* Currently allocated rx buffer */
  63.     struct mbuf *rcvq;    /* Receive queue */
  64.     unsigned rcvcnt;    /* Number of packets on queue */
  65.     unsigned rcvmax;    /* Maximum length of rcvq */
  66. };
  67.  
  68. extern struct pktdrvr pktdrvr[];
  69. #define    PK_MAX    3
  70.  
  71. #define    PKT_SIG    "PKT DRVR"    /* Packet driver signature */
  72.  
  73.